#※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
# File Name: debug.sh
# Author: GID5564
# Description: 调试配置，功能开关
# Created Time: 09/07/24-20:11:33
#※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
#! /usr/bin/env bash

# 避免重复导入
#[[ -n $__XLIB_IMPORTED__DEBUG ]] && return 0
#__XLIB_IMPORTED__debug=1


function __debug_init__(){
    export FILE_DEBUG=${FILE_CONFIG}
    import ini
}

#[section] 
#Enable = yes/no


#获取
function get_value(){
    local section=$1
    local key=$2
    local value=$(read_ini ${FILE_DEBUG} ${section} ${key})
}

#设置
function set_value(){
    local section=$1
    local key=$2
    local value=$3
    write_ini ${FILE_DEBUG} ${section} ${key} ${value}
}

#启用(yes/y)
function enable(){
    local section=$1
    set_value ${section} 'Enable' 'yes'
    eval "export ${section}='yes'"
}


#禁用(no/n)
function disable(){
    local section=$1
    set_value ${section} 'Enable' 'no'
    eval "export ${section}='no'"
}










































__debug_init__